<html>
    <head>
        <meta charset="utf-8">

        <link href="__CSS__bootstrap.min.css" type="text/css" rel="stylesheet">
        <link href="__CSS__content.css" type="text/css" rel="stylesheet">
        <script src="__JS__jquery-3.1.1.min.js"></script>
        <script src="__JS__bootstrap.min.js"></script>
    </head>
    <body>
          <!--导航栏-->
       <include file="Public:header" />

        <div class="col-sm-offset-1 col-md-offset-1 col-sm-10 col-md-10 panel panel-default">
            <div class="page-header">
				<h2 style="display:inline;color:red;">
				<if condition="$context[0]['type2'] eq 0">
					(原创)
				<else/>
					(转载)
				</if>
				</h2>
                <h1 style="display:inline;">{$context[0].title}<small>{$context[0].time}</small></h1>
            </div>
            <div class="col-md-12 col-sm-12 page-body">
                <h3>分类：
					<volist name="tags2" id="vo">
                        <if condition="$i%6 eq 0">
                        <a style="margin: 0.2em 0.1em;" class="tag"><span class="Labe2 label label-default">{$vo}</span></a>
                        <elseif condition="$i%6 eq 1"/>
                        <a style="margin: 0.2em 0.1em;" class="tag"><span class="Labe2 label label-primary">{$vo}</span></a>
                        <elseif condition="$i%6 eq 2"/>
                        <a style="margin: 0.2em 0.1em;" class="tag"><span class="Labe2 label label-success">{$vo}</span></a>
                        <elseif condition="$i%6 eq 3"/>
                        <a style="margin: 0.2em 0.1em;" class="tag"><span class="Labe2 label label-info">{$vo}</span></a>
                        <elseif condition="$i%6 eq 4"/>
                        <a style="margin: 0.2em 0.1em;" class="tag"><span class="Labe2 label label-warning">{$vo}</span></a>
                        <elseif condition="$i%6 eq 5"/>
                        <a style="margin: 0.2em 0.1em;" class="tag"><span class="Labe2 label label-danger">{$vo}</span></a>
                        </if>
                    </volist>
				</h3>
            </div>
            <div class="col-md-12 col-sm-12" style="background-color:#AAAAAA;"></div>
            <!--文章内容-->
            <div class="col-sm-12 col-md-12 panel panel-body" style="margin: 4% auto;">
                {$context[0].context|htmlspecialchars_decode}
            </div>

			<!--分享插件-->
			<div class="col-sm-12 col-md-12 panel">
				<!-- JiaThis Button BEGIN -->
				<div class="jiathis_style_32x32">
					<a class="jiathis_button_qzone"></a>
					<a class="jiathis_button_tsina"></a>
					<a class="jiathis_button_tqq"></a>
					<a class="jiathis_button_weixin"></a>
					<a class="jiathis_button_renren"></a>
					<a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
					<a class="jiathis_counter_style"></a>
				</div>
				<script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
				<!-- JiaThis Button END -->
			</div>
			
			
            <div class="col-sm-12 col-md-12 Labe2" style="background-color: #a8a8a8;width:100%;height:0.2em;">
            </div>
            <include file="Public:tip" />
			
            <div class="col-sm-12 col-md-12 panel panel-default">
                <div>
                    <h3>留言</h3>
                                    <div id="comment" class="modal-body footer-comments col-sm-12 col-md-12">
                                            <volist name="comments" id="vvo">
                                            
                                                <div class="col-sm-12 col-md-12 panel panel-default">
                                                    <div class="col-sm-12 col-md-12 panel panel-header">
                                                        <h4>
                                                        <if condition="$vvo['parent'] neq ''">
                                                            {$vvo['username']} 回复：{$vvo['parent']}
                                                            <else/>
                                                            {$vvo['username']}
                                                        </if>
                                                        </h4>
                                                    </div>
                                                    <div class="col-sm-12 col-md-12 panel-body">
                                                        {$vvo['content']}
                                                    </div>
                                                    <div class="col-sm-12 col-md-12">
                                                        <span>
                                                        <i class="glyphicon glyphicon-time"></i>
                                                        {$vvo['time']}
                                                        </span>                                   
                                                        <span>
                                                        <a class="clickopen" data-replyid="reply{$vvo['id']}">
                                                        <i class="glyphicon glyphicon-send"></i>
                                                            回复{$vvo['username']}
                                                        </a>
                                                        <div id="reply{$vvo['id']}" class="hidden">
                                                            <div class="col-sm-12 col-md-12 foot-comment2" contentEditable="true" style="border:1px solid #AAAAAA; padding:1em;margin-bottom:1em;"></div>
                <button type="button" class="btn btn-primary footer-summit2"data-replyname="{$vvo['username']}" data-id="{$context[0].id}" style="margin-bottom: 0.5em">发表评论</button>
                                                        </div>
                                                        </span>
                                                    </div>
                                                </div>
                                            </volist>
                                        </div>
                </div>

                <h3>评论</h3>
                <div class="col-sm-12 col-md-12 foot-comment" contentEditable="true" style="border:1px solid #AAAAAA; padding:1em;margin-bottom:1em;"></div>
                <button type="button" class="btn btn-primary footer-summit" data-id="{$context[0].id}" style="margin-bottom: 0.5em">发表评论</button>
            </div>


        </div>

        <!--辅助的功能 返回顶部 返回首页-->
         <div style="position:fixed;
                right:25px;
                bottom:10em;
                width:6em;
                height:6em;
                background-color: #232323;
                border-radius: 1em;
                z-index:100;" class="text-center">
             <span class="text-center">
                 <a href="__ADMIN__Article/allcontent" class="glyphicon glyphicon-th-list" style="font-size:4.5em;color:#ededed;text-decoration: none;">
                     <small style="font-size:0.1em;">文章列表</small>
                </a>
             </span>
        </div>
        <div style="position:fixed;
                right:25px;
                bottom:2em;
                width:6em;
                height:6em;
                background-color: #232323;
                border-radius: 1em;
                z-index:100;" class="text-center">
             <span class="text-center">
                <a href="#top" class="glyphicon glyphicon-arrow-up" style="font-size:4.5em;color:#ededed;text-decoration: none;">
                     <small  style="font-size:0.1em;">返回顶部</small>
                </a>
             </span>
        </div>
          <include file="Public:footer"/>
        
    </body>
   <script type="text/javascript">
   //时间返回
        function getNowFormatDate() {
            var date = new Date();
            var seperator1 = "-";
            var seperator2 = ":";
            var month = date.getMonth() + 1;
            var strDate = date.getDate();
            if (month >= 1 && month <= 9) {
                month = "0" + month;
            }
            if (strDate >= 0 && strDate <= 9) {
                strDate = "0" + strDate;
            }
            var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                    + " " + date.getHours() + seperator2 + date.getMinutes()
                    + seperator2 + date.getSeconds();
            return currentdate;
        }



        //监听是否选择回复其他人的评论
        $('.clickopen').on('click',function(){
            var id = $(this).data('replyid');
            var obj = $("#"+id);
            if(obj.hasClass("hidden")){
                $("#"+id).removeClass('hidden');
                $("#"+id).addClass('show');
            }else{
                $("#"+id).removeClass('show');
                $("#"+id).addClass('hidden');
            }
        });
        //监听回复某人的事件
        $('.footer-summit2').on('click',function(){
            var cObj =  $("#comment");
            var parent = $(this).parent();
            var parid = $(parent).attr("id");
            var comment = $("#"+parid+" .foot-comment2").text();
            var replyname = $(this).data('replyname');
            var id = $(this).data("id");
			if(comment==''){
				alert('留言不能为空！');
				return;
			}
            $.ajax({
                        "url":"__ADMIN__Article/addcomment",
                        "type":"POST",
                        "data":{
                            "content":comment,
                            "id":id,
                            "parent":replyname,
                            "time":getNowFormatDate()
                        },
                        "error": function(XMLHttpRequest, textStatus, errorThrown) {
                            
                        },
                        "success":function(data,textStatus){
							if(data=='llbnwk'){
								alert('留言不能为空！');
							}
                           window.location.reload();
                        }
                })
        });
        //监听提交按钮
            $('.footer-summit').on('click',function(){
                var comment = $(".foot-comment").text();
                var id = $(this).data("id");
                //评论对象
                var cObj =  $("#comment");
                    $.ajax({
                        "url":"__ADMIN__Article/addcomment",
                        "type":"POST",
                        "data":{
                            "content":comment,
                            "id":id,
                            "time":getNowFormatDate()
                        },
                        "error": function(XMLHttpRequest, textStatus, errorThrown) {
                           
                        },
                        "success":function(data,textStatus){
							if(data=='llbnwk'){
								alert('留言不能为空！');
							}
                           window.location.reload();
                        }
                })
            });
   </script>
</html>